package cn.iocoder.yudao.module.crossborder.order.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 跨境电商客户等级枚举
 *
 * @author LHL
 */
@AllArgsConstructor
@Getter
public enum CustomerLevelEnum {

    NORMAL(1, "普通"),
    SILVER(2, "银牌"),
    GOLD(3, "金牌"),
    DIAMOND(4, "钻石"),
    VIP(5, "VIP"),
    ;

    /**
     * 等级值
     */
    private final Integer level;
    
    /**
     * 等级名称
     */
    private final String name;

    public static CustomerLevelEnum getByLevel(Integer level) {
        for (CustomerLevelEnum value : values()) {
            if (value.getLevel().equals(level)) {
                return value;
            }
        }
        return null;
    }

}
